// +----------------------------------------------------------------------
// | CmsWing [ 美业管理系统 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 psi All rights reserved.
// +----------------------------------------------------------------------
// | Author: huang <2374266244@qq.com>
// +----------------------------------------------------------------------
'use strict';
import Base from './base.js';

export default class extends think.Controller{
  

  /*
  *红包
  */

  async indexAction(){
  	let id = this.get('id');
  	id = 1;
  	let rinfo = await this.model('or_shop_redbox').where({id:id}).find();
  	this.assign('rinfo',rinfo);
  	//平分金钱
  	if(0!=rinfo.nownum){
  		let money = rinfo.amount/rinfo.num;
  		money = money.toFixed(2);
  		this.assign('money',money);
  	}
  	return this.display('demo.html');
  }

  async getboxAction(){
  	return this.display();
  }

  
}